refactor: refactor list stages' warehouse filter for consistency#6163
Merged
krancour merged 1 commit intoakuity:mainfrom Apr 24, 2026
Merged
Conversation
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6163 +/- ##
==========================================
+ Coverage 57.67% 57.69% +0.01%
==========================================
Files 474 474
Lines 40506 40518 +12
==========================================
+ Hits 23362 23376 +14
+ Misses 15749 15748 -1
+ Partials 1395 1394 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jacobboykin
added a commit
to jacobboykin/kargo
that referenced
this pull request
Apr 24, 2026
Promotes two helpers that were living in pkg/server to pkg/api/stage.go, alongside GetStage, ListFreightAvailableToStage, and the rest of the Stage-domain operations. Both are now exported and unit-tested: - StripStageForSummary: in-place projection that clears heavy fields (freightHistory[1..], promotionTemplate step configs, health.output) from a Stage. Previously a package-private helper in pkg/server/list_stages_v1alpha1.go. - ListStageHealthOutputs: given a project and a set of Stage names, returns map[name]raw-health-output. Previously inlined (twice — once for the ConnectRPC handler and once for the REST handler) in pkg/server/get_stage_health_outputs_v1alpha1.go, alongside a private uniqueNonEmptyStrings helper that is now folded into the exported function. The server handlers are now thin adapters that validate transport-level concerns (batch-size cap) and delegate domain work to pkg/api. This matches the convention akuity#6163 establishes for StageMatchesAnyWarehouse / ListStagesByWarehouses. Signed-off-by: Jacob Boykin <boykinmusic@gmail.com> Signed-off-by: Jacob Boykin <jacob.boykin@akuity.io>
jacobboykin
approved these changes
Apr 24, 2026
jacobboykin
added a commit
to jacobboykin/kargo
that referenced
this pull request
Apr 24, 2026
…n/stage-summary-api Applies Kent's pkg/api Stage-domain consolidation ahead of its merge so this branch is ready to land cleanly once akuity#6163 is in main. Kent's PR promotes stageMatchesAnyWarehouse + listStagesByWarehouses from pkg/server into pkg/api (exported, unit-tested, options-struct shaped). Our REST listStages handler now calls api.ListStagesByWarehouses directly. Our ConnectRPC ListStages handler does its list inline so it can surface list.ResourceVersion for the list-then-watch response field; filtering still goes through api.StageMatchesAnyWarehouse to keep the matching logic in one place. Signed-off-by: Jacob Boykin <boykinmusic@gmail.com> Signed-off-by: Jacob Boykin <jacob.boykin@akuity.io>
jessesuen
approved these changes
Apr 24, 2026
Member
jessesuen
left a comment
There was a problem hiding this comment.
Apologies for not noticing this pattern in my PR!
Member
Author
|
It was easy to miss, no worries. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #6153